import request from '@/utils/request'

// 添加角色
const fetchAddRole = (params) => {
  return request({
    url: '/role/add',
    method: 'get',
    params
  })
}

// 获取角色列表
const fetchRoleList = () => {
  return request({
    url: '/role/list',
    method: 'post'
  })
}
// 删除角色
const fetchDelRole = (params) => {
  return request({
    url: '/role/del',
    method: 'get',
    params
  })
}

// 添加用户角色
const fetchAddRoleUser = (params) => {
  return request({
    url: '/role/user/add',
    method: 'get',
    params
  })
}
// 获取用户角色列表
const fetchRoleUserList = () => {
  return request({
    url: '/role/user/list',
    method: 'post'
  })
}
// 删除角色用户
const fetchDelUrlRole = (params) => {
  return request({
    url: '/role/user/del',
    method: 'get',
    params
  })
}
// 修改角色用户状态
const fetchEditUrlRole = (params) => {
  return request({
    url: '/role/user/edit',
    method: 'get',
    params
  })
}
export default {
  fetchRoleList,
  fetchAddRole,
  fetchAddRoleUser,
  fetchRoleUserList,
  fetchDelRole,
  fetchDelUrlRole,
  fetchEditUrlRole
}
